
<div class="menu-left-child-2">
    <?
    global $db;
    $modul = CM_getParameter('modul');
    $action = CM_getParameter('action');
    switch ($modul) {
	case "products":
	    include_once DIR_MODEL . 'md_products.class.php';
	    echo "<h3>Sản Phẩm</h3>";
	    products_type(0, 0);
	    break;
	case "services":
	    include_once DIR_MODEL . 'md_services.class.php';
	    echo "<h3>Dịch Vụ</h3>";
	    services_type(0, 0);
	    break;
	case "gallery":
	    include_once DIR_MODEL . 'md_gallery.class.php';
	    echo "<h3>Bộ Sưu Tập</h3>";
	    gallery_type(0, 0);
	    break;
	case "event":
	    include_once DIR_MODEL . 'md_event.class.php';
	    echo "<h3>Sự Kiện</h3>";
	    events_type(0, 0);
	    break;

	default:
	    break;
    }

    function products_type($parent_id, $level) {
	global $db;
	$objProducts = new MD_Products($db);
	$where = " type_parent = '$parent_id'";
	$order = "id ASC";
	$limit = "";
	$array = $objProducts->get_product_type_by_Where($where, $order, $limit);
	foreach ($array as $value) {
	    $id = $value['id'];
	    echo "<p><a class='memu_left_div' href='?modul=products&action=List&parent_id=" . $id . "'>" . str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $level) . " " . $value['type_name'] . "</a><p>";
	    products_type($id, $level + 1);
	}
    }

    function gallery_type($parent_id, $level) {
	global $db;
	$objGallery = new MD_Gallery($db);
	$where = " parent_id = '$parent_id'";
	$order = "";
	$limit = "";
	$array = $objGallery->get_gallery_type_by_Where($where, $order, $limit);
	foreach ($array as $value) {
	    $id = $value['id'];
	    echo "<p><a class='memu_left_div' href='?modul=gallery&action=List&parent_id=" . $id . "'>" . str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $level) . " " . $value['gallery_type_name'] . "</a><p>";
	    gallery_type($id, $level + 1);
	}
    }

    function services_type($parent_id, $level) {
	global $db;
	$objServices = new MD_Services($db);
	$where = " parent_id = '$parent_id'";
	$order = "";
	$limit = "";
	$array = $objServices->get_services_type_by_Where($where, $order, $limit);
	foreach ($array as $value) {
	    $id = $value['id'];
	    echo "<p><a class='memu_left_div' href='?modul=services&action=List&parent_id=" . $id . "'>" . str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $level) . " " . $value['service_type_name'] . "</a><p>";
	    services_type($id, $level + 1);
	}
    }

    function events_type($parent_id, $level) {
	global $db;
	$objEvent = new MD_Event($db);
	$where = " parent_id = '$parent_id'";
	$order = "";
	$limit = "";
	$array = $objEvent->get_events_type_by_Where($where, $order, $limit);
	foreach ($array as $value) {
	    $id = $value['id'];
	    echo "<p><a class='memu_left_div' href='?modul=event&action=List&parent_id=" . $id . "'>" . str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $level) . " " . $value['event_type_name'] . "</a><p>";
	    events_type($id, $level + 1);
	}
    }
    ?>
</div>
<?
include_once DIR_MODEL . 'md_home.class.php';
$objModel = new MD_Home($db);
$arr = $objModel->getById("");
$name_of_website = $arr[3]['info_content'];
$address = $arr[4]['info_content'];
$phone_number = $arr[5]['info_content'];
$email = $arr[6]['info_content'];
?>
<div>&nbsp;</div>
<div class="menu-left-child-2">
    <div class="font_menuleft_contact"><strong><u>Thông tin liên hệ: </u></strong></div>
    <div class="menu-left-contact"><?= $name_of_website ?></div>
    <div class="font_menuleft_contact" style="font-style: italic;">
	<p>- Địa Chỉ: <?= $address ?></p>
	<p>- SĐT: <?= $phone_number ?></p>
	<p>- Email: <?= $email ?></p>
	<div>
	    Bản đồ:<br/><br/>
	    <div>
		<?
		include_once 'include/map_address.php';
		V_Map_Add('300px', '220px', '16', $arr[8]['info_content']);
		?>
	    </div>
	</div>
    </div>
</div>